Skip to content

feat(usvg): add warning when parsing malformed paths - #1011

Merged
LaurenzV merged 3 commits into
linebender:mainfrom
Its-Just-Nans:add-parsing-warning
Aug 1, 2026
Merged

feat(usvg): add warning when parsing malformed paths#1011
LaurenzV merged 3 commits into
linebender:mainfrom
Its-Just-Nans:add-parsing-warning

Conversation

@Its-Just-Nans

Copy link
Copy Markdown
Contributor

Linked to #938

$ cargo run --package usvg a.svg b.svg

Warning (in usvg::parser::shapes:33): Error during path parsing: invalid number at position 9

@Its-Just-Nans Its-Just-Nans changed the title feat: add warning feat(usvg): add warning of error during parsing Jan 28, 2026
@LaurenzV

LaurenzV commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

I've removed the warning from transform parsing, because we already print warnings for nodes attributes that fail to parse, so it's being printed twice:

match T::parse(*self, aid, value) {
Some(v) => Some(v),
None => {
// TODO: show position in XML
log::warn!("Failed to parse {} value: '{}'.", aid, value);
None
}

But the one for paths looks fine to me (those are just parsed as raw strings so they aren't detected earlier.

@LaurenzV LaurenzV changed the title feat(usvg): add warning of error during parsing feat(usvg): add warning when parsing malformed paths Aug 1, 2026
@LaurenzV

LaurenzV commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

@LaurenzV
LaurenzV merged commit 488592b into linebender:main Aug 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants